package com.tiantian.util;

import java.io.IOException;
import java.util.Properties;

public class ConfigUtil {
	public static Properties properties;

	public static final String PIC_ROOT = "pic.root";

	public static synchronized void init() throws IOException {
		if (properties == null) {
			properties = new Properties();
			properties.load(ConfigUtil.class.getClassLoader().getResourceAsStream("config/config.properties"));
		}
	}

	public static String getProperty(String key) {
		try {
			init();
		} catch (IOException e) {
			e.printStackTrace();
		}
		return (String) properties.get(key);
	}
}
